{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from gs_quant.common import Currency\n",
    "from gs_quant.instrument import IRXccySwap, IRXccySwapFltFlt\n",
    "from gs_quant.session import Environment, GsSession"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# external users should substitute their client id and secret\n",
    "GsSession.use(Environment.PROD, client_id=None, client_secret=None, scopes=('run_analytics',))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# IRXccySwap is a MTM cross currency swap.  IRXccySwapFltFlt doesn't exchange on each payment date\n",
    "\n",
    "# spreads are absolute so 0.0005 is 5bp\n",
    "xswap = IRXccySwap(\n",
    "    payer_currency=Currency.EUR,\n",
    "    receiver_currency=Currency.USD,\n",
    "    effective_date='3m',\n",
    "    termination_date='10y',\n",
    "    payer_spread=-0.0005,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(xswap.price())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "xswap_mtm = IRXccySwapFltFlt(\n",
    "    payer_currency=Currency.EUR,\n",
    "    receiver_currency=Currency.USD,\n",
    "    effective_date='3m',\n",
    "    termination_date='10y',\n",
    "    payer_spread=-0.0005,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(xswap_mtm.price())"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  },
  "tags": [
   "Instrument - XCcy Swap"
  ]
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
